#include "StdAfx.h"
#include "StartPageWnd.h"
#include "..\StormWidgetUILibrary\AnimJobUI.h"

CStartPageWnd::CStartPageWnd(void)
{
}

CStartPageWnd::~CStartPageWnd(void)
{
}

LPCTSTR CStartPageWnd::GetWindowClassName() const 
{ 
	return _T("UIStart"); 
}

LPCTSTR CStartPageWnd::GetDialogResource() const 
{ 
	return L"<Dialog>"
		L"<HorizontalLayout>"
		L"<VerticalLayout width=\"150\" >"
		L"<Toolbar>"
		L"<ToolGripper />"
		L"</Toolbar>"
		L"<NavigatorPanel>"
		L"<PaddingPanel height=\"18\" />"
		L"<NavigatorButton name=\"page_start\" text=\"<i 0> Start\" selected=\"true\" tooltip=\"Vis start siden\" />"
		L"<NavigatorButton name=\"page_registers\" text=\"<i 4> Registre\" tooltip=\"Vis forskellige registre\" />"
		L"<NavigatorButton name=\"page_systems\" text=\"<i 4> Systemer\" />"
		L"<NavigatorButton name=\"page_configure\" text=\"<i 4> Opsning\" />"
		L"<NavigatorButton name=\"page_reports\" text=\"<i 4> Rapporter\" />"
		L"</NavigatorPanel>"
		L"</VerticalLayout>"
		L"<VerticalLayout>"
		L"<Toolbar>"
		L"<LabelPanel align=\"right\" text=\"<f 6><c #fffe28>Start Side</c></f>\" />"
		L"</Toolbar>"
		L"<ToolbarTitlePanel text=\"<f 7>Bjarke's Test Program</f>\" />"
		L"<TitleShadow />"
		L"<WindowCanvas watermark=\"blackground\" >"
		L"<VerticalLayout>"
		L"<TextPanel text=\"<f 8>aaa</h>\" />"
		L"<FadedLine />"
		L"<TileLayout scrollbar=\"true\" >"
		L"<TextPanel name=\"link_registers\" text=\"<i 7 50><a><f 6>&Registre</f></a>\n<h>\n<c #444540>Vdenne menu for at rette i diverse registre i systemet.\n\nDu kan rette i kunde, vogn og chauff-reigsteret.\" shortcut=\"R\" />"
		L"<TextPanel name=\"link_systems\" text=\"<i 9 50><a><f 6>&Systemer</f></a>\n<h>\n<c #444540>Gennem denne menu kan du opste diverse ting.\" shortcut=\"S\" />"
		L"<TextPanel name=\"link_configure\" text=\"<i 6 50><a><f 6>Opsning</f></a>\n<h>\n<c #444540>Opsning giver adgang til konfiguration af de mange ksels-systemer og regler.\" />"
		L"<TextPanel name=\"link_reports\" text=\"<i 5 50><a><f 6>Rapporter</f></a>\n<h>\n<c #444540>Rapporter giver dig overblik over registre samt hverdagens ture og bestillinger.\n\nGennem statistik og lister kan du hurtigt f?prenteret historiske data fra systemet.\" />"
		L"</TileLayout>"
		L"</VerticalLayout>"
		L"</WindowCanvas>"
		L"</VerticalLayout>"
		L"</HorizontalLayout>"
		L"</Dialog>";     
}

void CStartPageWnd::OnPrepareAnimation()
{
	COLORREF clrBack = m_pm.GetThemeColor(UICOLOR_WINDOW_BACKGROUND);
	RECT rcCtrl = m_pm.FindControl(_T("link_registers"))->GetPos();
	m_pm.AddAnimJob(CAnimJobUI(UIANIMTYPE_FLAT, 0, 350, clrBack, clrBack, 
		CRect(rcCtrl.left, rcCtrl.top, rcCtrl.left + 50, rcCtrl.top + 50), 40, 0, 4, 255, 0.3f));
	rcCtrl = m_pm.FindControl(_T("link_systems"))->GetPos();
	m_pm.AddAnimJob(CAnimJobUI(UIANIMTYPE_FLAT, 200, 350, clrBack, clrBack, 
		CRect(rcCtrl.left, rcCtrl.top, rcCtrl.left + 50, rcCtrl.top + 50), 40, 0, 4, 255, 0.3f));
	rcCtrl = m_pm.FindControl(_T("link_configure"))->GetPos();
	m_pm.AddAnimJob(CAnimJobUI(UIANIMTYPE_FLAT, 100, 350, clrBack, clrBack, 
		CRect(rcCtrl.left, rcCtrl.top, rcCtrl.left + 50, rcCtrl.top + 50), 40, 0, 4, 255, 0.3f));
	rcCtrl = m_pm.FindControl(_T("link_reports"))->GetPos();
	m_pm.AddAnimJob(CAnimJobUI(UIANIMTYPE_FLAT, 250, 350, clrBack, clrBack, 
		CRect(rcCtrl.left, rcCtrl.top, rcCtrl.left + 50, rcCtrl.top + 50), 40, 0, 4, 255, 0.3f));
	//CAnimJobUI* p = new CAnimJobUI(UIANIMTYPE_FLAT, 0, 350, clrBack, clrBack, 
		//CRect(rcCtrl.left, rcCtrl.top, rcCtrl.left + 50, rcCtrl.top + 50), 40, 0, 4, 255, 0.3f);
}

void CStartPageWnd::Init()
{
}
